package com.qf.petmall.starter.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Timer;

/**
 * <p>
 * 
 * </p>
 *
 * @author author
 * @since 2022-12-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("shop_cart")
@ApiModel(value="ShopCart对象", description="")
public class ShopCart implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "购物车id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "商品id")
    @TableField("product_id")
    private Integer productId;

    @ApiModelProperty(value = "商品图片")
    @TableField("product_img")
    private String productImg;

    @ApiModelProperty(value = "用户id")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty(value = "购买数量")
    @TableField("product_num")
    private Integer productNum;

    @ApiModelProperty(value = "总价")
    @TableField("product_price")
    private Float productPrice;

    @ApiModelProperty(value = "商品规格")
    @TableField("product_prop")
    private String productProp;

    @ApiModelProperty(value = "购物车添加时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @TableField("cart_time")
    private Date cartTime;

    @TableField(exist=false)
    private String productName;

    @TableField(exist=false)
    private String homeClass;
}
